Say how a file is protected and what it allows - #9
Merged
Conversation
A document that opened has already been decrypted, and said nothing about what it had been protected with on the way. Document.Protection now reports it: the method in words — RC4-40, RC4-128, AES-128, AES-256, or none for a file that declares a security handler and then protects nothing with it — the handler's revision, the permissions the file grants, and whether the password it opened with was the owner's, in which case those permissions do not apply. Working out which password opened a file meant carrying that back from the two key derivations, so a legacy candidate now says whether reaching it meant knowing the owner's password rather than the user's. Permissions gains Allows and String, so that what a file grants can be put in front of a person as words rather than as a bit pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A document that opened has already been decrypted, and said nothing about what it had been protected with on the way.
Document.Protection()now reports it:Working out which password opened a file meant carrying that back from both key derivations, so a legacy candidate now says whether reaching it meant knowing the owner's password rather than the user's.
PermissionsgainsAllowsandString, so what a file grants can be put in front of a person as words —print, copy— rather than as a bit pattern.This is what
opsneeds for apermissionsverb, and whatpdfopsneeds to answer "what is this file, and what may I do with it".100% statement coverage,
go vetand gofmt clean.